<template>
	<view>
		<view class="container">
			<view class="container_top">按路线</view>
			<view class="container_key">
				<input v-model="shipZone" class="input" placeholder="请输入区域"></input>
				<image src="@/static/iocn16.png" @click="exchange()"></image>
				<input v-model="placeShip" class="input" placeholder="请输入区域"></input>
			</view>
			<view class="container_box" @click="seek()">查看</view>
		</view>
		<view>
			<Tabbar :current="'0'"></Tabbar>
		</view>
	</view>
</template>

<script>
	import {
		GetDedLines,
		RouteSetting
	} from '@/public/Api/update.js'
	import {
		setValue,
		getValue
	} from '@/public/storeage/index.js'
	import Tabbar from '@/pages/navigation/sjnavigation.vue';
	// import pickerAddress from '@/components/wangding-pickerAddress/wangding-pickerAddress.vue'
	export default {
		components: {
			//注册组件
			Tabbar,
			// pickerAddress
		},
		data() {
			return {
				
				skipCount:0,
				maxResultCount:10,
				shipZone:"",
				placeShip:''
			};
		},
		methods:{
			// change(data) {
			// 	this.shipZone = data.data.join('')
			// },
			// changes(data) {
			// 	this.placeShip = data.data.join('')
			// 	console.log(this.placeShip)
			// },
			exchange(){
				var Inavs = this.shipZone
				var Iname = this.placeShip
				this.placeShip= Inavs
				this.shipZone= Iname
			},
			async seek() {
				var skipCount=this.skipCount
				var maxResultCount=this.maxResultCount
				var origAddr=this.shipZone
				var destAddr=this.placeShip
			   
				try {
					const {
						data: res
					} = await GetDedLines({
						skipCount,
						maxResultCount,
						origAddr,
						destAddr
					})
					console.log(res)
					if(res.success==true){
						uni.navigateTo({
							url: '/pages/Findspecialline/seek?origAddr='+this.shipZone+'&destAddr='+this.placeShip
						})
					}
				} catch (e) {}
				
			},
			
			// 获取通话记录
			async RouteSetting() {
				var skipCount = this.skipCount
				var maxResultCount = this.maxResultCount
				var id = getValue('id')
				try {
					const {
						data: res
					} = await RouteSetting({
						skipCount,
						maxResultCount,
						id
					})
				} catch (e) {}
			},
		}
	}
</script>

<style lang="scss">
	page{background-color: #f7f7f7;padding: 20upx 15upx 0;}
	.container{
		border-radius: 17upx;
		background: #FFFFFF;
		box-shadow: 1.75upx 1.75upx 7.01upx 0px #e5e5e5, 1.75upx 1.75upx 7.01upx 0px #e5e5e5;
		padding: 30upx 50upx;
		.container_top{
			width: 130upx;
			height: 50upx;
			border-radius: 17upx;
			background-color: #EF4D3D;
			font-size: 26upx;
			color: #fff;
			text-align: center;
			line-height: 50upx;
		}
		.container_key{
			display: flex;
			align-items: center;
			justify-content: space-between;
			padding-top: 70upx;
			.input{
				width: 230upx;
				text-align: center;
				border-bottom: 1upx solid #ccc;
				font-size: 24upx;
			}
			
			image{
				width: 47upx;
				height: 47upx;
			}
		}
		.container_box{
			width: 490upx;
			height: 53upx;
			line-height: 53upx;
			text-align: center;
			color: #fff;
			border-radius: 17upx;
			margin: 0 auto;
			background-color: #EF4D3D;
			font-size: 28upx;
			margin-top: 68upx;
		}
	}
</style>
